package cn.santi.service.impl;

import cn.santi.domain.adminLog;
import cn.santi.mapper.LogMapper;
import cn.santi.service.LogService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper lm;
    @Override
    public void addLog(adminLog adminLog) {
        lm.insert(adminLog);
    }

    @Override
    public List<adminLog> getLog() {
        LambdaQueryWrapper<adminLog> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderBy(true,false,adminLog::getOperationTime);
        return lm.selectList(wrapper);
    }

    @Override
    public List<adminLog> getLogClassify(String classify) {
        return lm.getLogClassify(classify);
    }

    @Override
    public int adminDeleteLog() {
        return lm.adminDeleteLog();
    }
}
